//获取body
let body = document.querySelector('body')
// console.log(body);ok


function toast(msg) {
    const div = document.createElement('div')
    div.classList = `toastbox`
    div.textContent=msg
     div.style.display='block'
    body.append(div)

  //  设置计时器
    setTimeout(function(){
        div.style.display='none'
    },1500)

    // console.log(div);



}


//暴露函数
module.exports = {
    toast: toast
}